{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "[Sven Kreiss](https://www.svenkreiss.com/), 2020\n",
    "\n",
    "# Contribute\n",
    "\n",
    "Before we can accept contributions, you need to become a CLAed contributor.\n",
    "E-mail a signed copy of the\n",
    "[CLAI](https://github.com/vita-epfl/openpifpaf/blob/master/CLAI.txt)\n",
    "(and if applicable the\n",
    "[CLAC](https://github.com/vita-epfl/openpifpaf/blob/master/CLAC.txt))\n",
    "as PDF file to research@svenkreiss.com."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "(modify-code)=\n",
    "## Modify Code\n",
    "\n",
    "For development of the openpifpaf source code itself, you need to clone this repository and then:\n",
    "\n",
    "```sh\n",
    "pip3 install numpy cython\n",
    "pip3 install --editable '.[dev,train,test]'\n",
    "```\n",
    "\n",
    "The last command installs the Python package in the current directory\n",
    "(signified by the dot) with the optional dependencies needed for training and\n",
    "testing. If you modify `functional.pyx`, run this last command again which\n",
    "recompiles the static code.\n",
    "\n",
    "Develop your features in separate feature branches. \n",
    "Create a pull request with your suggested changes. Make sure your code passes\n",
    "`pytest` and `pylint` checks."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Things to Contribute\n",
    "\n",
    "This is a research project and changing fast. Contributions can be in many areas:\n",
    "* Add a new dataset?\n",
    "* Add a new base network? \n",
    "* Try a different loss? \n",
    "* Try a better multi-task strategy?\n",
    "* Try a different head architecture? \n",
    "* Add a new task? \n",
    "* Run on new hardware (mobile phones, embedded devices, ...)? \n",
    "* Improve training schedule/procedure?\n",
    "* Use it to build an app?\n",
    "* Improve documentation (!!)\n",
    "* ..."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Build Guide\n",
    "\n",
    "```sh\n",
    "cd guide\n",
    "jb build .\n",
    "```\n",
    "\n",
    "If you encounter issues with the kernel spec in the notebooks, this is a piece of code that is used to normalize the kernel spec names in the guide geployment script:\n",
    "\n",
    "```sh\n",
    "for fn in *.ipynb; do\n",
    "    jq '(.metadata.kernelspec.name,.metadata.kernelspec.display_name)=\"python3\"' ${fn} > ${fn}_\n",
    "    mv ${fn}_ ${fn}\n",
    "done\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Build Environment"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip freeze"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Scratch"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Uncomment when using on Google Colab:\n",
    "# !pip install --upgrade openpifpaf==0.11.1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!python -m openpifpaf.predict --version"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "python3",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4-final"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
